Prescriptive architecture for application development

ABSTRACT

A prescriptive architecture for application development is provided. In some embodiments, the architecture comprises a service, a receiver, a sender, and a transport. The service functions to perform the actual business logic, is decorated with service deployment metadata; and is operable to communicate via types. The receiver is coupled to the service and is generated entirely from the service deployment metadata. The receiver is operable to receive messages, convert the received messages into types, and communicate with the service using the types. The sender is coupled to the receiver and is generated entirely from the service deployment metadata. The sender functions as a proxy for the service to a service consumer, and is operable to communicate using types with the service consumer. The sender is operable to convert the types to messages, and communicate with the receiver via messages. The transport functions as a message exchange technology that allows the sender and receiver to communicate, and is designated by the service deployment metadata and implemented as an underlying technology of the sender and the receiver.

TECHNICAL FIELD

The described technology is directed generally to applicationdevelopment and, more particularly, to an architecture for applicationdevelopment.

BACKGROUND

There is a current trend in software design toward modeling anddelivering software logic and applications as services. With the growthof the Internet, and in particular, the maturing of the World Wide Web(“Web”), application developers are increasingly delivering theseservices as Web services.

As an example, an application developer may need to write some businesslogic and may want to package up the business logic in a way to exposeit as a Web service. Typically, the developer will have to define aninterface with the necessary input data, and will also have to definethe output. The developer then writes the business logic that does someamount of work using the designed input and which creates the output. Inaddition to writing the business logic, the developer will also have towrite logic for ancillary requirements to the business logic, such asauditing, security, error handling, caching, etc.

For example, the service may need to cache the output value. In order toproperly incorporate this feature into the service, the developer willhave to (1) check the value of the outputs, (2) create a kind of keybased on those values, (3) match the key with a possible value in thecache and return the value if there is a match, otherwise proceed to theservice logic to create the output value, and (4) add it to the cachebefore returning it back to the caller. The developer wilt need todesign and implement other attributes of the cache, such as a strategyfor expiring an item in the cache, a strategy for notification in theinstance an item in the cache is expired, etc.

The developer will need to perform a similar task for each of theancillary requirements. Additionally, because Web services typicallycommunicate over a network, the developer will need to design and codethe communication infrastructure for the service. Developing anddelivering a large number of services in this manner can get tedious,especially given the fact that the ancillary requirements and thecommunication infrastructure do not contribute to the business logic.Further, the cost and complexity of implementing the Web services isincreasingly becoming prohibitive, particularly for small to mediumsized organizations.

One reason for this is that while the business logic generally does notchange, the underlying and ancillary technologies are very likely tochange over time. Presently, numerous standards that address variousaspects of Web services are evolving and/or being developed. Because theWeb services typically include the ancillary logic, the Web servicesand, particularly, the ancillary logic will have to be modified andenhanced as these standards evolve and develop in order to takeadvantage of the standards.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating selected components typicallyincorporated in at least some computer systems on which a facilitydescribe below executes.

FIG. 2 is a high-level block diagram showing an environment in whichcomponents generated by the facility operate.

FIG. 3 is a block diagram illustrating selected components of thefacility, according to one embodiment.

FIG. 4 illustrates a flow chart of a method by which a service developerutilizes the facility to develop and deploy a service, according to someembodiments.

FIG. 5 illustrates an example code snippet of a calculator applicationcontaining service deployment metadata.

FIG. 6 illustrates the example code snippet of FIG. 5 further containingan aspect container attribute.

FIG. 7 illustrates an example code snippet illustrating both a classlevel and a method level aspect container deployment.

FIG. 8 illustrates a flow chart of a method by which the facilitycompiles the intermediary language assemblies, according to someembodiments.

FIG. 9 is a block diagram illustrating an example aspect container.

FIG. 10 is a display diagram showing a portion of an example graphicaluser interface suitable for configuring and administering frameworks,aspects, and aspect containers.

FIG. 11 illustrates a flow chart of a method by which the facilitygenerates an aspect container at runtime, according to some embodiments.

FIG. 12 is a block diagram illustrating aspect containers attached toboth a sender and a receiver, according to one embodiment.

DETAILED DESCRIPTION

The invention will now be described with respect to various embodiments.The following description provides specific details for a thoroughunderstanding of, and enabling description for, these embodiments of theinvention. However, one skilled in the art will understand that theinvention may be practiced without these details. In other instances,well-known structures and functions have not been shown or described indetail to avoid unnecessarily obscuring the description of theembodiments of the invention.

The terminology used in the description presented below is intended tobe interpreted in its broadest reasonable manner, even though it isbeing used in conjunction with a detailed description of certainspecific embodiments of the invention. Certain terms may even beemphasized below; however, any terminology intended to be interpreted inany restricted manner will be overtly and specifically defined as suchin this Detailed Description section.

In general, brief definitions of several terms used herein are precededby the term being enclosed within double quotation marks. Suchdefinitions, although brief, will help those skilled in the relevant artto more fully appreciate aspects of the invention based on the detaileddescription provided herein. Such definitions are further defined by thedescription of the invention as a whole (including the claims) and notsimply by such definitions.

Before describing the details of the current invention, some terminologyused herein is described.

The term “aspects” generally refers to functional areas that are‘cross-cutting’ or apply uniformly across a variety of usage instances.Aspects are ‘orthogonal’ to the application code and may includefunctionality such as, by way of example, auditing, instrumentation,security, caching, exception handling, validation, etc.

The term “aspect container” generally refers to a unit of aspectdeployment. The aspect container organizes and coordinates the aspects,and is used to attach aspects to any class or method. In someembodiments, an aspect container deployed at, the class level governsall exposed methods on the class, unless overridden by a method-levelaspect container—e.g., another aspect container deployed on the method.

The term “assembly” generally refers to a collection of types andresources that are built to work together and form a logical unit offunctionality. In .NET, an assembly provides the common language runtimewith the information it needs to be aware of type implementations. Tothe common language runtime, a type does not exist outside the contextof an assembly.

The term “messages” generally refers to structured information exchangedbetween two services.

The term “plumbing” generally refers to serializing data as XML,transporting the data using HTTP, and de-serializing the XML back tomeaningful data.

The term “receiver” generally refers to an incoming pipe, and isgenerated entirely from a service definition. In some embodiments, thereceiver is plumbing.

The term “sender” generally refers to an outgoing pipe, and is generatedentirely from a service definition. In some embodiments, the sender isplumbing.

The term “services” generally refers to the delivery of functionality byexchanging messages over transports. Services contain the actualbusiness logic—i.e., the custom code—and are responsible for performingbusiness logic, interacting with the data, coordinating other services,etc.

The term “transports” generally refers to message exchange orcommunication technologies that allow services to communicate.

The term “types” generally refers to the data types specified byprogramming languages to store different kinds of data.

Various embodiments of the invention provide a software facility forbuilding software applications (“the facility”). The facility iscomprised of reusable architecture components that provide valuableservices and assistance to developers who are building the applications.For example, the facility enables the developer to build applicationsthat can be deployed faster, with better quality and increased agility.

Although the various embodiments of the invention will be described as acompliment and extension of the Microsoft® .NET Framework, includingterminology similar to that used in .NET, the description is merelyillustrative and not limiting. As such, it will be appreciated that thevarious components of the facility, including the various features, canbe adapted to compliment and extend other application development anddeployment platforms. In addition, while the invention is describedherein with respect to the development and deployment of services, thoseskilled in the art will appreciate that the facility can be adapted tofacilitate the development and deployment of applications andapplication programs in general.

In some embodiments, a service developer that wants to package up anapplication as a service creates the actual business logic for theservice. The service developer then enhances the business logic withservice deployment metadata to define the service's associated sendersand receivers. The service developer then utilizes the facility towholly generate the senders and receivers from the service deploymentmetadata specified in the business logic. Senders and receiverstypically come in pairs and create an extensible architecture to hidedetails of the underlying transports. The senders and receivers thusprovide a mechanism to protect the applications—i.e., businesslogic—from rapidly changing messaging standards.

Optionally, the service developer can attach one or more aspectcontainers on the business logic. In one embodiment, an aspect containeris used to attach aspects to any class or method. The aspect containerorganizes and coordinates the aspects and is used to build a managedchain of responsibility to ‘preamble’ and ‘postamble’ the activities ofthe application—e.g., class or method. In operation, each aspect in theaspect container has a chance to exercise itself both before and afterthe call to the class or method. The application of the aspect containergenerates a sequence of aspects, where the order of the aspects andtheir respective internal states are retrieved from their respectiveconfiguration data.

In some embodiments, aspect containers may be attached to a sender, areceiver, or both the sender and receiver. Moreover, aspect containerscan be applied mix-and-match to any service element—i.e., sender orreceiver. In operation, if a method call has been attributed with anaspect container containing an aspect or a chain of aspects, the aspector chain of aspects function to ‘intercept’ the method call the clientcode is targeting. Once intercepted, the aspect or chain of aspectsobtains the target method call information, and the aspects each executein sequence. After executing in sequence, the ‘real’ or interceptedmethod—i.e., the transport code if attached to the sender, or the actualbusiness logic if attached to the receiver—executes, and then eachaspect executes in reverse sequence. Thus, the aspects provide theservice developer a declarative way to control many facets ofapplication behavior, and serve as an effective shield to changes inunderlying functionality, such as Web services, and to reduce the amountof new custom code required to generate the service. Another benefitprovided by the aspects is that application architecture functionalitythat is not fundamental to the service and service transports can beapplied at deployment or run-time through configuration.

Separate from the application development, the service developer,service architect, or other knowledgeable person, utilizes the facilityto define the aspect containers that are made available for attachmentto the business logic. In one embodiment, each aspect container isdifferent from the others only in the name of the aspect container thatis provided. A configuration file having the same name as the name ofthe aspect container contains the actual definition of the contents ofthe aspect container, and the particular configuration of each aspect inthe aspect container is expressed in a respective aspect configurationfile, such as, by way of example, an XML file. The aspect containercontains logic to read the contents of its corresponding configurationfile—e.g., as provided by the name of the aspect container—and to usethe information in the configuration file to populate itself—i.e.,create an instance of the aspect container containing instances of theaspects.

Having created the actual business logic, decorated the business logicwith the service deployment metadata, and optionally attached one ormore aspect containers on the business logic, the service developer usesthe facility to compile the business logic. As a result of the compileoperation and depending on the specified service deployment metadata,the facility outputs three assemblies: a service sender; a servicereceiver; and a contracts assembly containing the custom types used bythe service. The service developer deploys the assemblies into anexecution environment for consumption and service publishing. Forexample, the execution environment may comprise one or more clients andone or more servers. Here, the sender can be deployed to some or all ofthe clients, and the receiver and the business logic—i.e., theservice—can be deployed to some or all of the servers. If the servicedeveloper added functionality to the client—i.e., sender—side byattaching one or more aspect containers, the appropriate configurationfile for each aspect container, and the configuration files for theaspects specified by the aspect container, are also deployed into theexecution environment, in this instance, the client, in order that theaspect containers can be populated and their contents cached on theclient during execution of the sender.

Once the service is deployed into the execution environment, the servicebecomes available for consumption. A service consumer wanting to consumea specific service references the desired service sender in the clientcode. The referenced service sender functions as a ‘proxy’ for theactual service and encapsulates the details of the transport specificcode. Because the service sender encapsulates the transport specificcode, the client code is able to simply request an instance of theservice without having to worry about transport-level details. In otherembodiments, a service consumer may consume a service without using theprovided service sender. In this instance, the service consumer needs toformat the service request in the client code in the message format theservice expects, which typically requires writing additional codespecifically for the service technology. In one embodiment, the servicerequest is formatted using standard Service Oriented ArchitectureProtocols (SOAP).

The various embodiments of the facility and its advantages are bestunderstood by referring to FIGS. 1-12. The elements of the drawings arenot necessarily to scale, emphasis instead being placed upon clearlyillustrating the principles of the invention. Throughout the drawings,like numerals are used for like and corresponding parts of the variousdrawings.

FIG. 1 is a block diagram illustrating selected components typicallyincorporated in at least some of the computer systems on which thefacility executes. These computer systems 100 may include one or morecentral processing units (“CPUs”) 102 for executing computer programs; acomputer memory 104 for storing programs and data—including datastructures—while they are being used; a persistent storage device 106,such as a hard drive, for persistently storing programs and data; acomputer-readable media drive 108, such as a CD-ROM drive, for readingprograms and data stored on a computer-readable medium; and a networkconnection 110 for connecting the computer system to other computersystems, such as via the Internet, to exchange programs and/ordata—including data structures.

The facility may be described in the general context ofcomputer-readable instructions, such as program modules, executed bycomputer systems 100 or other devices. Generally, program modulesinclude routines, programs, objects, components, data structures, etc.that perform particular tasks or implement particular abstract datatypes. Memory 104 and persistent storage device 106 arecomputer-readable media that may contain instructions that implement thefacility. It will be appreciated that memory 104 and persistent storage106 may have various other contents in addition to the instructions thatimplement the facility.

It will be appreciated that computer systems 100 may include one or moredisplay devices for displaying program output, such as video monitors orLCD panels, and one or more input devices for receiving user input, suchas keyboards, microphones, or pointing devices such as a mouse. Whilecomputer systems 100 configured as described above are typically used tosupport the operation of the facility, it will be appreciated that thefacility may be implemented using devices of various types andconfigurations, and having various components.

In the discussion that follows, embodiments of facility are described inconjunction with a variety of illustrative examples. It will beappreciated that the embodiments of facility may be used incircumstances that diverge significantly from these examples in variousrespects.

FIG. 2 is a high-level block diagram showing an environment 20 in whichcomponents generated by the facility operate. In general terms,environment 20 provides a service architecture, which abstracts theinfrastructure details of individual messaging technologies from thebusiness logic. The service architecture infrastructure takes care ofgenerating the code necessary to enable an application to exchangemessages, thus enabling service implementers to concentrate ondelivering business functionality. As depicted, environment 20 comprisesa service 202, a receiver 204, and a sender 206. In particular, receiver204 and sender 206 are coupled through a network 208. As used herein,the terms “connected,” “coupled,” or any variant thereof, means anyconnection or coupling, either direct or indirect, between two or moreelements; the coupling of connection between the elements can bephysical, logical, or a combination thereof.

Service 202 generally functions to deliver functionality by exchangingmessages over transports, which support asynchronous invocation ofservices 202. Service 202 contains the actual business logic. As such,service 202 is custom code and is responsible for actions such asperforming the contained business logic, interacting with the data, andcoordinating other services. In one embodiment, service 202 is decoratedwith service deployment metadata, which defines their associated sendersand receivers. For example, a service developer adds the metadata to thebusiness logic without modifying the actual business logic. The metadatais expressed as attributes on elements in the actual source code.

Receiver 204 generally functions as a transport suitable for receivingmessages, and also functions to convert the received messages intotypes, and pass the types to its corresponding service 202 forprocessing. In this regard, receiver 204 facilitates plumbing. Receiver204 is generated entirely by the facility from the servicedefinition—i.e., service deployment metadata—specified in acorresponding service 202. In one embodiment, the facility reads asinput the service deployment metadata contained in service 202 andgenerates (1) the communications logic necessary to implement themessage exchange technology to enable receiver 204 to function as atransport suitable for receiving messages, (2) the logic necessary toconvert the messages into types, and (3) the logic necessary to pass thetypes to the appropriate service 202. Examples of message exchangetechnologies include communication technologies such as in-processtransport, which exposes the service functionality as an in-memoryobject; Microsoft® .NET Remoting transport, which exposes the servicefunctionality as a server-activated, single call object using .NETRemoting stack; Microsoft® ASP.NET Web Services (ASMX) transport, whichexposes the service functionality as an ASP.NET endpoint; Web ServiceEnhancements for Microsoft® .NET (WSE) 2.0 transport, which exposes theservice functionality securely over TCP and HTTP; and otherreadily-available and suitable transports. A technical advantage is thatreceiver 204, by being wholly generated by the facility, allows theservice developer to be transport neutral—i.e., the service developerdoes not have to develop the custom communications code.

Sender 206 generally functions as a proxy for its corresponding service202. As such, sender 206 converts types into messages and also functionsas a transport mechanism suitable for sending the messages to itscorresponding receiver 204. In this regard, sender 206 facilitatesplumbing. Sender 206 is generated entirely by the facility from theservice definition—i.e., service deployment metadata—specified in itscorresponding service 202. In one embodiment, the facility reads asinput the service deployment metadata contained in service 202 andgenerates (1) the logic necessary to present service 202 as a proxy, (2)the logic necessary to convert the types into messages, and (3) thecommunications logic necessary to implement the message exchangetechnology to enable sender 206 to function as a transport suitable forsending messages.

One technical advantage is that sender 206 makes it easy to dropmessages into the communications pipe to its corresponding receiver 204,and ultimately to service 202. Another technical advantage is thatsender 202 preserves type fidelity across the messaging boundary, ifdesired. A further technical advantage is that sender 206, by beingwholly generated by the facility, allows the service consumer to betransport neutral—i.e., the service consumer does not have to developthe custom communications code.

One skilled in the art will appreciate that senders 206 are not requiredto communicate with receivers 204. In this instance, services 202 can beconsumed by any application that supports and is able to use themessaging technology. Stated another way, the application developer willneed to develop and incorporate the functionality provided by thesenders—e.g., the code generated by the facility in creating thesenders—into the application, thus enabling the application tocommunicate via messages with the appropriate receivers.

Between sender 206 and receiver 204, the paradigm is message exchange,and the contract is based on transport and encoding. On both ends ofthis ‘pipeline’—i.e., between the service consumer (not depicted) andsender 206, and between receiver 204 and service 202—the paradigm istypes. A resulting technical advantage is that there is no imposition ofcoding or data transport style into the application code. Moreover,while a sender and receiver pair can be used to exchange messages, itwill be appreciated that the sender is not required. For example, anyagent that is capable of conforming to the schema can send and receivemessages to and from the receiver.

Network 208 is a communications link that facilitates the transfer ofelectronic content between, for example, the attached computers. In oneembodiment, network 208 includes the Internet. It will be appreciatedthat network 208 may be comprised of one or more other types ofnetworks, such as a local area network, a wide area network, apoint-to-point dial-up connection, and the like. It will also beappreciated that network 208 may not be present. For example, sender 206and receiver 204 may both reside on the same computing system andcommunicate via communication mechanisms, such as, interprocesscommunication, remote function call, internal communication buses, etc.,typically supported on the computing system.

FIG. 3 is a block diagram illustrating selected components of thefacility, according to one embodiment. As depicted, the facilityincludes a service generator 302 and framework assemblies 304. Servicegenerator 302 generally functions to create the service assemblies thatare deployed to the environment for consumption and service publishing.In one embodiment, service generator 302 receives as input theintermediary language assemblies that are generated by compiling thebusiness logic, and scans the input assemblies to identify the servicedeployment metadata attributes, and based on the attributes, generatesthe senders, receivers, and contracts assemblies corresponding to thebusiness logic—i.e., service. Service generator 302 is further discussedbelow.

In general terms, framework assemblies 304 enable aspect containers atruntime. Framework assemblies 304 generally function as a suite ofapplication architectural functionality that the applications canre-use. Framework assemblies 304 include the code, configuration files,tools and resources, aspects and their corresponding configurationfiles, and the aspect containers and their corresponding configurationfiles. In some embodiments, framework assemblies 304 extend and providehooks into Microsoft® .NET Framework. As such, in some embodiments,framework assemblies 304 may refer to all or parts of Microsoft® .NETFramework. A technical advantage is that framework assemblies 304 enablemany key behaviors to be defined centrally, outside of the applicationcode. This allows service developers the flexibility to focus on theapplication code without having to worry about the secondary orancillary tasks, such as, communication, caching, logging, security,validation, error reporting, etc.

In some embodiments, the facility provides a graphical user interfaceand configuration tools to enable a user to manage the application orservice configuration. For example, the user can use the interface andtools to configure frameworks, define aspects, and define aspectcontainers. The facility may also provide a graphical user interface andtools to enable the user to create custom frameworks and/or aspects andto add the created frameworks and/or aspects into framework assemblies304 for subsequent use.

The aforementioned components of the facility are only illustrative, andthe facility may include other components and modules not depicted.Furthermore, the functionality provided for in the components andmodules may be combined into fewer components and modules or furtherseparated into additional components and modules.

FIG. 4 illustrates a flow chart of a method 400 by which a servicedeveloper utilizes the facility to develop and deploy a service,according to some embodiments. By way of example, a service developermay want to develop a calculator application that returns the sum of twovariables “arg1” and “arg2,” and package the calculator application andexpose it as a service. Beginning at a start step, the service developerdevelops the logic—e.g., code—for the calculator application, at step402. Strings 502, 504 and 506 in FIG. 5 illustrate an example codesnippet of the calculator application.

At step 404, the service developer references framework assemblies 304in the code. By referencing framework assemblies 304, the servicedeveloper is able to attach aspect containers, specify serviceattributes, and otherwise declaratively add functionality and behaviorto the application logic. Continuing the calculator application example,string 508 in FIG. 5 illustrates an example code snippet of a referenceto the framework assemblies 304. In the example code snippet,“XYZ.ACA.Services” is the name of the framework assemblies.

At step 406, the service developer attributes the business logic as aservice. The attribute serves as an indication to the facility and, inparticular, service generator 302, that a service is to be created fromthe business logic. In one embodiment, the attributes, which aremetadata, are specified in the business logic using squarebrackets—i.e., specified between “[” and “]” brackets. Continuing thecalculator application example, attribute 510 in FIG. 5 serves as anindication that the calculator application is to be generated as aservice.

At step 408, the service developer specifies the set of transports theservice is to be exposed over. The service developer may specify one ormore transports that are available in the particular frameworkassemblies 304 that are referenced in the code. Continuing thecalculator application example, attributes 512 and 514 in FIG. 5 serveas indications of the transports that are to be supported by thecalculator service. In particular, attributes 512 and 514 areindications that the calculator service is to be exposed over“AsmxTransport” and “WseTransport,” respectively.

At step 410, the service developer specifies one or more classes and/ormethods that are to be exposed over the set of transports specified instep 408. In the calculator application example, the service developerspecified that the method “Add” as indicated by string 504 is to beexposed over the ASMX Transport and the WSE Transport. This is indicatedby attribute 516 in FIG. 5, which also serves as an indication thatservice generator 302 is to create a sender and receiver pair for eachspecified transport, and a contracts assembly for the method “Add.”

One skilled in the art will appreciate that the number of transports andmethods specified above are only illustrative. For example, the servicedeveloper may have specified a different number of and/or differentmethods that are to be exposed. Also, the service developer may havespecified a different number of and/or different transports for thespecified method or methods to be exposed over. The types of transportsis limited by the transports supported in the framework assemblies thatare referenced by the code, and for each specified transport, thefacility generates a sender and receiver pair.

At step 412, the service developer may optionally attach an aspectcontainer on the exposed class or method. The service developer mayattach any aspect container that is available in the particularframework assemblies 304 that is referenced in the code. In oneembodiment, the aspect container can be attached to the sender that isgenerated for the exposed method, the receiver that is generated for theexposed method, or both the sender and the receiver. Continuing thecalculator application example, attribute 602 in FIG. 6 serves as anindication that the aspect container “CalcContainer” is to be attachedto the method “Add.” Moreover, attribute 602 further indicates that thescope of attachment for the aspect container as senders only, asindicated by “AspectContainerScope.SendersOnly.” Thus, attribute 602attaches the specified aspect container on the sender that is createdfor each specified transport. Alternatively, the service developer mayhave specified the scope of attachment to be receivers only—e.g.,“AspectContainerScope.ReceiversOnly”—or both senders and receivers—e.g.,“AspectContainerScope.Both.”

The aspect container also functions as a unit of reuse of aspect sets.Each named aspect represents an instance of aspect configuration,expressing the full functionality of the underlying core framework, andis the unit of aspect behavior reuse. Moreover, different aspectcontainers may be attached to the sender and the receiver. Statedanother way, senders and receivers may be governed by different aspectcontainers. Further, senders and receivers, as well as the service, maybe governed by a plurality of aspect containers. Aspect containers arefurther discussed below.

In one embodiment, the aspect container attribute—i.e., [AspectContainer(“CalcContainer”, AspectContainerScope.SendersOnly)] in the calculatorapplication example above—is the central abstraction. The named aspectcontainer contains one or more named aspects. It is the unit of aspectdeployment and it is deployed at the class or method level. Aspectcontainers deployed at the class level govern all exposed methods on theclass, unless overridden by a method level aspect container.

FIG. 7 illustrates an example code snippet illustrating both a classlevel and a method level aspect container deployment. Attribute 702precedes string 704, which defines the class “MyClass.” As such,attribute 702 serves as an indication that the aspect container“Container1” is a class level aspect container, and is to govern all theexposed methods in the class “MyClass,” unless overridden by an aspectcontainer directly deployed on an exposed method in the class. Attribute706 serves as an indication that the aspect container “Container2” is tobe attached to the method “GetMyData,” which is an exposed method in theclass “MyClass.” Thus, aspect container “Container2” is a method levelaspect container, which overrides or takes precedent over the classlevel aspect container “Container1.” As a result, class level aspectcontainer “Container1” is to be attached to all exposed methods in theclass “MyClass” except method “GetMyData.”

Referring again to method 400, at step 414, the service developercompiles the business logic, which includes the attributes for theservices and aspects, into intermediary language assemblies, such as, byway of example, libraries, dynamic link libraries, assemblies, objectfiles, etc. At step 416, the service developer uses the facility togenerate the service senders and receivers and a contracts assembly fromthe intermediary language assemblies.

FIG. 8 illustrates a flow chart of a method 800 by which the facilitycompiles the intermediary language assemblies, according to someembodiments. In particular, service generator 302 utilizes frameworkassemblies 304 to generate the service senders and receivers and thecontracts assembly. During a start step, the intermediary languageassemblies generated from the business logic is input to servicegenerator 302.

At step 802, service generator 302 scans through the assemblies lookingfor classes that have been designated as services. Continuing thecalculator application example, service generator 302 scans through theassemblies looking for classes that have been designated as[ACAService]. Then, for each of the service classes (step 804), servicegenerator 302 performs steps 806 to 812. At step 806, service generator302 builds an internal model of the class by reflecting over itsstructure and capturing all the details of the interfaces of the servicemethods. The model eliminates the ‘noise’ or unnecessary details thatare unimportant or not necessary for service generator 302 to create thesenders, receivers, and contracts. For example, a class may includethree methods, method 1, method 2, and method 3, of which only method 2is designated as a method to be exposed as a service. In this instance,the model will include method 2, but not methods 1 and 3. In oneembodiment, service generator 302 builds the model in internal memory.

At step 808, service generator 302 incorporates the specified aspectcontainers—e.g., [AspectContainer]—into the internal model. At step 810,service generator 302 incorporates the specified transportdesignations—e.g., [*Transport]—into the internal model. Continuing theaforementioned calculator application example, service generator 302incorporates [AspectContainer (“CalcContainer”,AspectContainerScope.SendersOnly)] and [AsmxTransport] and[WseTransport] into the internal model.

At step 812, service generator 302 generates the unified communicationsand aspect interception infrastructure used to deploy the business logicto the appropriate service channels—i.e., transports. The aspectinterception infrastructure ensures that the attached aspects are calledand processed prior to the business logic being processed as well asafter the business logic is processed. In one embodiment, the aspectinterception infrastructure is implemented as code that is included inthe sender and/or receiver to which the aspects are attached. Continuingthe calculator application example, service generator 302 produces thefollowing:

-   -   An ASMX Sender, which is enhanced with the aspect interception        mechanism for the “CalcContainer” AspectContainer. The ASMX        Sender is used to invoke the service functionality over the ASMX        transport. It calls the ASMX Receiver.    -   An ASMX Receiver, which is used to receive the message from the        ASMX Sender. It forwards the call on to the actual business        logic—i.e., the calculator application method “Add.”    -   A WSE Sender, which is enhanced with the aspect interception        mechanism for the “CalcContainer” AspectContainer. The WSE        Sender is used to invoke the service functionality over the WSE        transport. It calls the WSE Receiver.    -   A WSE Receiver, which is used to receive the message from the        WSE Sender. It forwards the call on to the actual business        logic—i.e., the calculator application method “Add.”    -   The business logic packaged as a service.    -   A contracts assembly, which specifies the data types for the        data used in the actual business logic—i.e., the calculator        application method “Add.”

Referring again to method 400, at step 418, the service developerdeploys the code into an execution environment. The senders and thecontracts produced by service generator 302 are typically deployed forconsumption on clients, while the receivers and the service are deployedon servers coupled to the clients. Furthermore, if a sender is enhancedwith aspects through the attachment of an aspect container, theappropriate framework assembly—e.g., framework assemblies 304—includingany necessary configuration information for the aspect container and theaspects, are also deployed with the client. Once deployed, the servicesare ready for consumption by service consumers. Continuing thecalculator application example, the ASMX Sender, the WSE Sender, thecontracts assembly, the aspect container “CalcContainer”, and theframework assembly “XYZ.ACA.Services,” including the necessaryconfiguration files for the aspect container “CalcContainer” and theconfiguration files for the aspects contained in “CalcContainer,” may bedeployed on one or more clients for consumption by service consumers,while the ASMX Receiver, the WSE Receiver, and the service may bedeployed on one or more servers coupled to these clients.

One skilled in the art will appreciate that, for this and other methodsand processes disclosed herein, the functions performed in the exemplaryflow charts may be implemented in differing order. Furthermore, thesteps outlined in the flow charts are only exemplary, and some of thesteps may be optional, combined into fewer steps, or expanded intoadditional steps without detracting from the essence of the invention.

FIG. 9 is a block diagram illustrating an example aspect container. Asdepicted, an aspect container 902 is coupled to an aspect containerconfiguration 904 and a plurality of aspects 906. Aspect container 902generally functions to create an instance of the plurality of aspects906 as specified in aspect container configuration 904. Aspect containerconfiguration 904 generally functions as a repository for theinformation used by aspect container 902 to generate an instance of theaspects. For example and as depicted in FIG. 9, aspect container 904 mayinclude a list of the aspects, “Aspect 1” through “Aspect N,” insequence. Each aspect contains the logic to perform a function thattypically apply uniformly across a variety of usage instances, such as,by way of example, auditing (e.g., capturing a log of the serviceactivity), instrumentation (e.g., capturing the service performanceinformation), security (e.g., applying authorization policies), caching(e.g., defining the caching behavior of the services), exceptionhandling (e.g., performing a defined behavior in the event of servicefailure or exception), and validation (e.g., defining the validity ofdata and applying the validation rules). One skilled in the art willappreciate that an aspect container can create an instance of zero, oneor more aspects as specified by its aspect configuration file.

In one embodiment, an aspect container is different from the otheraspect containers only in name. Other than reading in or inputting thecontents of a different aspect container configuration file, asindicated by the name of a particular aspect container, all aspectcontainers execute or perform the same logic to create the instances ofthe aspects as specified by the input configuration file. In thismanner, aspect containers organize and coordinate the aspects, and builda managed chain of aspects to ‘preamble’ and ‘postamble’ the applicationor business logic—e.g., class or method.

As depicted in FIG. 9, the plurality of aspects 906 includes a chain ofn aspects, “Aspect 1” through “Aspect N.” The order of the aspects inthe chain and each aspect's internal state is retrieved from arespective configuration file (not depicted). In operation, each aspectin the chain of aspects has a chance to execute both before and afterthe call to the class or method. For example, if the plurality ofaspects 906 is attached to a sender, the n aspects—i.e., “Aspect 1”through “Aspect N”—execute in sequence before a call to the service ismade utilizing the transport incorporated in the sender. Upon returnfrom the service, “Aspect N” through “Aspect 1” executes in reversesequence. Alternatively, if the plurality of aspects 906 is attached toa receiver, “Aspect 1” through “Aspect N” executes in sequence before acall to the service. Upon return from the service, “Aspect N” through“Aspect 1” executes in reverse sequence before returning to the senderthat originally invoked the service.

In some embodiments, the facility provides a graphical user interfaceand tools for configuring frameworks, aspects, and aspect containers. Inone embodiment, frameworks that are provided in framework assemblies,such as framework assemblies 304, need to be configured prior to theiruse. Assuming that framework assemblies 304 provides a cachingframework, a service developer may need to define characteristics of thecaching framework, such as a caching storage type (e.g., database),instance name (e.g. applications can have multiple instances), memorythreshold (e.g., the number of items in cache), polling interval (e.g.,how often to poll the cache of expired items), scavenging range (e.g.,how many items to remove from cache in case a specified threshold hasbeen reached), etc. In like manner, the service developer can define thecharacteristics for the other frameworks, such as an auditing framework,an instrumentation framework, a security framework, an exceptionhandling framework, a validation framework, and any other providedframework by specifying the general characteristics appropriate for theparticular framework.

Similarly, aspects and aspect containers also need to be configuredprior to their use. Assuming that the service developer wants to definea caching aspect, the service developer may need to (1) define anaspect, (2) specify the aspect's type as a caching aspect, and (3)define the necessary settings for this type of caching aspect, such as acache instance that is to be used, an expiration strategy, a purgingpriority in the instance the cache becomes too large, etc. In oneembodiment, the facility maintains the configuration information for theaspect in a configuration file associated with the configured aspect. Inlike manner, the service developer can configure other aspects. Havingconfigured one or more aspects, the service developer can define anaspect container and add aspects into the aspect container. In oneembodiment, the name of the aspect container needs to match thecontainer name used in the application or business code. Referring againto the calculator application example, the service developer needs toname the aspect container as “CalcContainer.”

FIG. 10 is a display diagram showing a portion of an example graphicaluser interface suitable for configuring and administering frameworks,aspects, and aspect containers. A window 1002 displays configurationinformation regarding the caching framework and allows a user to modifythe configuration information by selecting a displayed characteristicusing a pointing device such as a mouse, and providing the necessaryinformation. Window 1002 may provide the user the ability to enter theinformation by selecting one or more items from a drop-down or pop-upwindow. A window 1004 displays the aspects and aspect containers definedin an application “Calculator” in an expandable tree structure. In thisexample, as depicted, the available aspects are “Client Cache,” “Audit,”and “Admin Role Check,” and two aspect containers, “CalcContainer” and“SecurityCheck,” are configured. The aspect container “CalcContainer”contains the aspects “Audit” and “Client Cache” in that sequence, andthe aspect container “SecurityCheck” contains the aspect “Admin RoleCheck.” Window 1004 allows the user the ability to select aspects andaspect containers in order to add aspects into and remove aspects out ofaspect containers. For example, the user can add an aspect to an aspectcontainer by using a pointing device, such as a mouse, and selecting anaspect or multiple aspects and manipulating the selected aspects toplace the selected aspects into the aspect container. The user canlikewise remove an aspect or multiple aspects by selecting the aspectsand removing the aspects out of the aspect container. Window 1004 alsodisplays the configuration information for an aspect or aspect containerin response to its user selecting the aspect or aspect container. Forexample, the configuration information may be displayed in window 1002or another window—e.g., a pop-up window.

Once an aspect container is added to the code, the specification of theparticular aspects associated with that container may be accomplishedthrough a graphical user interface, such as the user interfaceillustrated in FIG. 10. A technical advantage to externalizing theapplication of particular aspects to a named aspect container is thatthere is an unprecedented level of control over the full suite of aspectbehaviors. For example, what was once a laborious and ofteninconsistently implemented coding task is now a matter of policy, whichcan be controlled by architects and/or administrators.

Another technical advantage is that aspects and aspect containers allowdevelopers to be shielded from those ever changing businessrequirements. For example, the business logic does not care that it isbeing audited or that the return value for a particular method needs tobe cached and persisted to a database to survive reboots. The businesslogic developer does not need to write this code anymore since thefunctionality can now be added outside of the actual code throughexternal configuration.

Still another technical advantage is that aspects and aspect containersenable applications to be built or developed much faster since asignificant amount of application functionality can be simply expressedthough configuration instead of through hand-coding. This also addsquality to the applications because many tasks that once depended oncustom code to manipulate aspect-like frameworks, such as authorization,is now implemented through tested and proven aspects. Further, aspectsand aspect containers increase the agility of the applications becausemany important facets of application behavior are externalized andconfigurable at or after deployment time.

FIG. 11 illustrates a flow chart of a method 1100 by which the facilitygenerates an aspect container at runtime, according to some embodiments.By way of example, an aspect container may have been deployed into anexecution environment as part of a service sender or a service receiver.When the code—i.e., sender or receiver—is deployed, each aspectcontainer instance is different from the others only in the name of thecontainer that is provided, and the actual definition of the contents ofthe container and the particular configuration of each aspect in eachcontainer is expressed externally in a file, such as an XML file. Then,when each aspect container is initially invoked by the generatedinterception mechanism, the aspect container, at step 1102, checks todetermine if it is populated and cached in memory. If the aspectcontainer determines that it had not previously populated itself—i.e.,created an instance of itself—and cached the instance in memory, then,at step 1104, the aspect container reads in the configurationinformation from its corresponding configuration file and uses theconfiguration information to populate itself.

Steps 1106 through 1114 illustrate one embodiment of a method by whichthe aspect container populates itself. At step 1106, the aspectcontainer identifies the aspects that need to be created. For eachaspect that needs to be created, the aspect container performs steps1108 to 1112. At step 1108, the aspect container uses contents—i.e.,aspect definitions, etc.—of the framework assemblies and creates aninstance of the aspect and places it in the container—e.g., withinitself. At step 1110, the aspect container configures the aspectinstance according to the configuration information and detailscontained in the aspect's configuration fife. At step 1112, the aspectcontainer chains the aspect instances together in a sequence. The aspectcontainer retrieves the sequence information from its configurationfile. Once the aspect container finishes populating itself, the aspectcontainer caches its contents—i.e., the created instances of theaspects—in memory. By caching itself in memory, the aspect containerprovides efficiency in subsequent calls. For example, the aspectcontainer does not have to populate itself if its instance is cached inmemory.

If, at step 1102, the aspect container determines that it had previouslypopulated and cached itself, or subsequent to populating itself, theaspect container executes each aspect in sequence, at step 1116. At step1118, the method—e.g., the actual service business functionality—isexecuted. in one embodiment, the last aspect in the chain of aspectsexecutes and then initiates a call to the method. Subsequent to themethod executing, the aspect container executes the chain of aspects inreverse sequence, at step 1120.

FIG. 12 is a block diagram illustrating aspect containers attached to asender and a receiver. In particular, a sender “Sender 1” is deployed ona client, and a receiver “Receiver 1” and a service “Service 1” aredeployed on a server. An aspect container “Aspect Container S1” isattached to “Sender 1,” and “Aspect Container S1” is comprised of achain of three aspects, “Aspect 1,” “Aspect 2,” and “Aspect 3.” Thus,when initially invoked, “Aspect Container S1” populates itself byreading in its configuration contained in, for example, “Container S1Configuration” and creating an instance of the chain of aspects. “AspectContainer S1” also configures each aspect instance in the chain with itsparticular details contained in, for example, “Aspect 1 Configuration,”“Aspect 2 Configuration,” and “Aspect 3 Configuration.” Subsequent topopulating itself, control passes through “Aspect Container S1,” whichexecutes “Aspect 1,” “Aspect 2,” and “Aspect 3” in sequence, thenexecutes the actual service functionality, “Service 1,” via a call to“Receiver 1.” Upon receiving a response from “Service 1” via “Receiver1,” “Aspect Container S1” executes each aspect in reverse sequence—e.g.,“Aspect 3” then “Aspect 2” then “Aspect 1.” In one embodiment, theconfiguration files—e.g., “Container S1 Configuration,” “Aspect 1Configuration,” “Aspect 2 Configuration,” and “Aspect 3Configuration”—are deployed on the client.

On the server, an aspect container “Aspect Container R1” is attached to

“Receiver 1,” and “Aspect Container R1” is comprised of a chain of twoaspects, “Aspect 1” and “Aspect 4.” Thus, when initially invoked, forexample, by receiving a message from “Sender 1,” “Aspect Container R1”populates itself by reading in its configuration contained in, forexample, “Container R1 Configuration” and creating an instance of thechain of aspects. “Aspect Container R1” also configures each aspectinstance in the chain with its particular details contained in, forexample, “Aspect 1 Configuration” and “Aspect 4 Configuration.”Subsequent to populating itself, control passes through “AspectContainer R1,” which executes “Aspect 1” and “Aspect 4” in sequence,then executes the actual service functionality, “Service 1.” Uponreceiving a response from “Service 1,” “Aspect Container R1” executeseach aspect in reverse sequence—i.e., “Aspect 4” then “Aspect 1.” In oneembodiment, the configuration files—i.e., “Container R1 Configuration,”“Aspect 1 Configuration,” and “Aspect 4 Configuration”—are deployed onthe server as part of the framework assemblies, “Framework.”

Unless the context clearly requires otherwise, throughout thedescription and the claims, the words “comprise,” “comprising,” and thelike are to be construed in an inclusive sense, as opposed to anexclusive or exhaustive sense; that is to say, in the sense of“including, but not limited to.” The word “coupled”, as generally usedherein, refers to two or more elements that may be either directlyconnected, or connected by way of one or more intermediate elements.Additionally, the words “herein,” “above,” “below,” and words of similarimport, when used in this application, shall refer to this applicationas a whole and not to any particular portions of this application. Wherethe context permits, words in the above Detailed Description using thesingular or plural number may also include the plural or singular numberrespectively. The word “or” in reference to a list of two or more items,that word covers all of the following interpretations of the word: anyof the items in the list, all of the items in the list, and anycombination of the items in the list.

The above detailed description of embodiments of the invention is notintended to be exhaustive or to limit the invention to the precise formdisclosed above. While specific embodiments of, and examples for, theinvention are described above for illustrative purposes, variousequivalent modifications are possible within the scope of the invention,as those skilled in the relevant art will recognize. For example, whileprocesses or blocks are presented in a given order, alternativeembodiments may perform routines having steps, or employ systems havingblocks, in a different order, and some processes or blocks may bedeleted, moved, added, subdivided, combined, and/or modified. Each ofthese processes or blocks may be implemented in a variety of differentways. Also, while processes or blocks are at times shown as beingperformed in series, these processes or blocks may instead be performedin parallel, or may be performed at different times.

The teachings of the invention provided herein can be applied to othersystems, not necessarily the system described above. The elements andacts of the various embodiments described above can be combined toprovide further embodiments.

All of the above patents and applications and other references,including any that may be listed in accompanying filing papers, areincorporated herein by reference. Aspects of the invention can bemodified, if necessary, to employ the systems, functions, and conceptsof the various references described above to provide yet furtherembodiments of the invention.

These and other changes can be made to the invention in light of theabove Detailed Description. White the above description details certainembodiments of the invention and describes the best mode contemplated,no matter how detailed the above appears in text, the invention can bepracticed in many ways. Details of the architecture may varyconsiderably in its implementation details, white still beingencompassed by the invention disclosed herein. As noted above,particular terminology used when describing certain features or aspectsof the invention should not be taken to imply that the terminology isbeing redefined herein to be restricted to any specific characteristics,features, or aspects of the invention with which that terminology isassociated. In general, the terms used in the following claims shouldnot be construed to limit the invention to the specific embodimentsdisclosed in the specification, unless the above Detailed Descriptionsection explicitly defines such terms. Accordingly, the actual scope ofthe invention encompasses not only the disclosed embodiments, but alsoall equivalent ways of practicing or implementing the invention underthe claims.

While certain aspects of the invention are presented below in certainclaim forms, the inventors contemplate the various aspects of theinvention in any number of claim forms. For example, while only oneaspect of the invention is recited as embodied in a computer-readablemedium, other aspects may likewise be embodied in a computer-readablemedium. Accordingly, the inventors reserve the right to add additionalclaims after filing the application to pursue such additional claimforms for other aspects of the invention.

1. A computer-implemented method for generating a unified communicationsinfrastructure from an intermediary language assemblies of a businesslogic decorated with service deployment metadata, the method comprising:receiving as input an intermediary language assemblies generated from abusiness logic decorated with service deployment metadata; identifyingone or more classes designated as services in the intermediary languageassemblies, and for each identified service class: identifying one ormore methods in the service class that are to be exposed as services inthe intermediary language assemblies; identifying one or more transportdesignations in the intermediary language assemblies, each transportdesignation indicating a message exchange technology the service classesare to be exposed over; and generating a unified communicationsinfrastructure for the business logic, the unified communicationsinfrastructure comprising a service corresponding to each method that isto be exposed as a service, a contracts assembly specifying custom typesused by the service, and a sender and receiver pair for each service andtransport designation, such that each sender is operable to invoke theservice by transmitting a message over its underlying transport bycalling its corresponding receiver, each receiver operable to receivethe message from its corresponding sender and forward the call on to theservice, and each sender and receiver pair hides the details of theunderlying transport for the sender and receiver pair.
 2. The method ofclaim 1, wherein the service classes are specified by the servicedeployment metadata in the business logic.
 3. The method of claim 1,wherein the transport designations are specified by the servicedeployment metadata in the business logic.
 4. The method of claim 1,wherein the sender is wholly generated from the service deploymentmetadata.
 5. The method of claim 1, wherein the receiver is whollygenerated from the service deployment metadata.
 6. The method of claim1, wherein the message exchange technology supports asynchronousinvocation of the service.
 7. The method of claim 1 further comprising,for each identified service class, generating an internal model of theservice class, the internal model comprising the identified methods thatare to be exposed as services.
 8. The method of claim 7 furthercomprising, for each identified service class, generating an internalmodel of the service class, incorporating the transport designationsinto the internal model.
 9. The method of claim 7, wherein the unifiedcommunications infrastructure is generated using the internal model ofthe class.
 10. A computer-readable storage medium whose contents cause acomputer to: receive as input intermediary language assemblies generatedas a result of a compile operation on actual business logic enhancedwith service deployment metadata; scan through the intermediary languageassemblies to identify classes designated as services, and for eachidentified service class: identify one or more methods that are to beexposed as services in the intermediary language assemblies; identifyone or more transport designations specified in the intermediarylanguage assemblies, each transport designation indicating a transportthe service class is to be exposed over, wherein the transport is amessage exchange technology; and generate a communicationsinfrastructure for the business logic, the unified communicationsinfrastructure comprising a service corresponding to each method that isto be exposed in the class, a contracts assembly specifying custom typesused by the service, and a sender and receiver pair for each service andtransport designation, such that each sender is operable to invoke theservice by transmitting a message over its underlying transport bycalling its corresponding receiver, each receiver operable to receivethe message from its corresponding sender and forward the call on to theservice, and each sender and receiver pair hides the details of theunderlying transport for the sender and receiver pair.
 11. Thecomputer-readable storage medium of claim 10, wherein the serviceclasses are designated using the service deployment metadata in thebusiness logic.
 12. The computer-readable storage medium of claim 10,wherein the transport designations are specified using the servicedeployment metadata in the business logic.
 13. The computer-readablestorage medium of claim 10, wherein the sender is generated entirelyfrom the service deployment metadata.
 14. The computer-readable storagemedium of claim 10, wherein the receiver is generated entirely from theservice deployment metadata.
 15. The computer-readable storage medium ofclaim 10, wherein the message exchange technology includes an in-processtransport.
 16. The computer-readable storage medium of claim 10, whereinthe message exchange technology includes a .NET Remoting transport. 17.The computer-readable storage medium of claim 10, wherein the messageexchange technology includes a web services transport.
 18. Thecomputer-readable storage medium of claim 10, wherein the messageexchange technology includes a .NET transport.
 19. The computer-readablestorage medium of claim 10 further comprising content that cause thecomputer to, for each identified service class, generate an internalmodel of the class.
 20. The computer-readable storage medium of claim 19further comprising content that cause the computer to incorporate theidentified transport designations into the internal model of the class.21-42. (canceled)